C (207/301)

From:Rod Schnell
Date:19 Aug 99 at 22:15:01
Subject:Re: journey to nil:

From: Rod Schnell <rodsch@telusplanet.net>

Hello Radoslav

On 19-Aug-99, Radoslav Hodnicak wrote:
> From: Radoslav Hodnicak <rh@hysteria.sk>
>
> hello folks.
>
> can anybody please tell me what is neccessary to do to detach a program
> started from shell so the shell can be closed. i have no info about
> dos/proces structure etc. so i'm asking here.
>> NIL: <NIL: something? and cannot be it done
> after start?

Here's one way to do it.

if ( (in = Open("NIL:", MODE_OLDFILE)) && (out = Open("NIL:",
MODE_NEWFILE)) )
{
ret = SystemTags( routine, // STRPTR full path with args
SYS_Output, out,
SYS_Input, in,
SYS_Asynch, TRUE,
NP_StackSize, 16384,
NP_Cli, TRUE,
((currentdir) ? NP_CurrentDir : TAG_IGNORE), currentdir,
TAG_END );

if (async == 0)
{
Close(in);
Close(out);
}
}

Rod